#ifndef _ascendancy_galaxy_preview_
#define _ascendancy_galaxy_preview_

#include <QtOpenGL>
#include <QImage>
#include <QTimeLine>
#include <iostream>

#define	GALAXY_PRE_MAX_SIZE	200
#define GALAXY_PRE_CUBE_SIZE	200

#define SOL_SYS_COLOR_RED	1
#define SOL_SYS_COLOR_YELLOW	2
#define SOL_SYS_COLOR_WHITE	3
#define SOL_SYS_COLOR_BLUE	0

#define	SOL_SYS_BIG		0
#define	SOL_SYS_MEDIUM		1
#define SOL_SYS_SMALL		2

typedef		struct
{
  int		x;
  int		y;
  int		z;
  int		color;
  int		size;
} StarCoordT;

class		GalaxyPreview : public QGLWidget
{
  
  Q_OBJECT

public:
  
  GalaxyPreview(QWidget *parent = 0);
  ~GalaxyPreview();

  QSize		sizeHint() const;
  QSize		minimumSizeHint() const;

public slots:

  void		animate();
  void		changeNbStar(int newNb);

protected:

  float		rotation;

  void		initializeGL();
  void		paintGL();
  void		resizeGL(int w, int h);
  
  void		generateStars();

private:
  
  QWidget	*parent;
  std::vector<StarCoordT*> stars;
  // QTimer	*timer;
  int		nbStarToShow;

};



#endif
